<template>
		<!-- 添加问卷 -->
        <div class="question-preview">
			
			<div>
                <div><h3>{{questionnaire.name}}</h3></div>
				<div class="question-list" v-for="(item,idx) in questionnaire.questionnaireIssueVos" :key="idx">
						<div class="question-text">
							{{idx+1}}、{{item.name}}和大佛寺东方红是佛水电费搜的佛山大活佛收到货佛山大富豪
						</div>
						<div class="question-options">
							<el-radio-group v-if="item.type == 0">
								<el-radio disabled v-for="(val,idx) in item.questionnaireOptionVos" :key="idx" :label="val.name">{{val.name}}</el-radio>
							</el-radio-group>
							<el-checkbox-group v-if="item.type == 1">
								<el-checkbox disabled v-for="(val,idx) in item.questionnaireOptionVos" :key="idx" :label="val.name"></el-checkbox>
							</el-checkbox-group>
							<div v-if="item.type == 2">
								<textarea name="" disabled id="" style="width:100%" rows="10"></textarea>
							</div>
						</div>
					</div>
			</div>
			<div class="car-title center-button">
				<center>
					<el-button type="primary" @click="cancel">确认</el-button>
					<el-button type="primary" @click="cancel">取消</el-button>
				</center>
			</div>
			
		</div>
		
</template>

<script>
	export default {
		props:['questionId'],
		components: {
		},
		data() {
			return {
               questionnaire:''
			}
		},
		mounted() {
			this.get_question()
        },
        methods:{
             cancel(){
                this.$emit('questionnaire',1)
            },
            /* 获取问卷 */
            get_question(){
				var self = this
				this.$axios.get(this.$global.serverIp + 'frontend/questionnaire/detail/' + self.questionId)
				.then(res =>{
					if(res != ''){
                         self.questionnaire = res.data
					}
                      
                })
			}
        }

	}
	import '@/assets/css/common.css'
</script>
<style scoped>
  .question-list{
	  margin: 30px auto;
	  width: 800px;
  }
  .question-text{
	  margin-bottom: 20px;
  }
  .el-checkbox-group{
	  margin-left: 0;
  }
  h3{
        text-align: center;

  }

</style>
